package a0.commonAPI.compara.comparator;

import org.junit.Test;

import java.util.Arrays;

public class MyTest {

    @Test
    public void test() {
        Cat c1 = new Cat("xiaomao", 2);
        Cat c2 = new Cat("xiaomao", 7);
        Cat c3 = new Cat("xiaomao", 9);
        Cat c4 = new Cat("xiaomao", 5);

        Cat[] cats = {c1, c2, c3, c4};
        for (Cat cat : cats) {
            System.out.println(cat.toString());
        }

        Arrays.sort(cats,new DogComparator());

        for (Cat cat : cats) {
            System.out.println(cat.toString());
        }


    }

}
